﻿using Chloe.MySql; 
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EVEBattery.DB
{
    public static class DBHelperBase
    {
        public static MySqlContext CreateConnect(string ConnectString)
        {
            MySqlContext context = new MySqlContext(new MySqlConnectionFactory(ConnectString));
            return context;

        }

        public static bool TestIMSConn(string ConnectString)
        {

            var mySqlConnection = new MySqlConnection(ConnectString);
            try
            {
                mySqlConnection.Open();
                return mySqlConnection.State == ConnectionState.Open;

            }
            catch
            {
                return false;
            }
            finally
            {
                mySqlConnection.Close();
            }
        }

    }
}
